<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Admin Template">
    <meta name="keywords" content="admin dashboard, admin, flat, flat ui, ui kit, app, web app, responsive">
    <link rel="shortcut icon" href="/static/img/ico/favicon.png">
    <title>登录</title>

    <!-- Base Styles -->
    <link href="/static/css/style.css" rel="stylesheet">
    <link href="/static/css/style-responsive.css" rel="stylesheet">


</head>

<body class="login-body">

<div class="login-logo">
    <!--<img src="/static/img/login_logo.png" alt=""/>-->
</div>

<h2 class="form-heading">设计成本核算系统</h2>
<div class="container log-row">
    <h4 style="text-align: center;color: red" th:text="${msg}"></h4>
    <form class="form-signin" action="" method="post">
        <div class="login-wrap">
            <input id="username" type="text" class="form-control" placeholder="用户名" name="username" autofocus>
            <input id="password" type="password" class="form-control" placeholder="密码" name="password" >
            <button class="btn btn-lg btn-success btn-block" type="submit" id="">登录</button>
        </div>
    </form>
</div>

<!--jquery-1.10.2.min-->
<script src="/static/js/jquery-1.11.1.min.js"></script>
<!--Bootstrap Js-->
<script src="/static/js/bootstrap.min.js"></script>
<script>
    $("#loginBtn").click(function () {
        $.ajax({
            type:"POST",
            dataType:"json",
            url:"/sysuser/clickLogin",
            data:{
                "username":$("#username").val(),
                "password":$("#password").val()
            },
            success:function (res) {
                if (res.code==1){
                    //成功
                    window.location.href="/home";
                } else{
                    alert(res.msg);
                }
            },error:function (res) {
                console.log(res);
            }
        });
    });
</script>
</body>
</html>
